package com.liuyingxing.entity.account;

import com.liuyingxing.entity.common.AbstractEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * @File Menu.java
 * @Auth liuxing
 * @Date 2021/8/26 17:07
 * @Email liuxing997@foxmail.com
 */
@Entity
@Table(name = "account_menu")
public class Menu extends AbstractEntity {

    private static final long serialVersionUID = 1L;
    private String title;
    private String path;
    private String icon;
    private int parentId;
    // 菜单显示优先级，格式：parentId-index
    private int priority;
    @Transient
    private List<Menu> subItems;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public int getParentId() {
        return parentId;
    }

    public void setParentId(int parentId) {
        this.parentId = parentId;
    }

    public List<Menu> getSubItems() {
        return subItems;
    }

    public void setSubItems(List<Menu> subItems) {
        this.subItems = subItems;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

}